Rasterizing method

ABSTRACT

A rasterizing method calculates an attribute (C) of a pixel having coordinates (X, Y) based on the coordinates (X 0 , Y 0 ), (X 1 , Y 1 ), (X 2 , Y 2 ) of vertices of a primitive in a screen space, Z coordinates Z 0 , Z 1  and Z 2  of said vertices into the three-dimensional space, and attributes C 0 , C 1 , C 2  of said vertices. The method defines a vertex (X 0 , Y 0 ) as reference, the attribute (C) with the formula: 
     
       
         
           
             C 
             = 
             
               
                 
                   
                     
                       
                         
                           ( 
                           
                             
                               Δ 
                                
                               
                                   
                               
                                
                               
                                 X 
                                 20 
                               
                                
                               Δ 
                                
                               
                                   
                               
                                
                               
                                 Y 
                                 10 
                               
                             
                             - 
                             
                               Δ 
                                
                               
                                   
                               
                                
                               
                                 Y 
                                 20 
                               
                                
                               Δ 
                                
                               
                                   
                               
                                
                               
                                 X 
                                 10 
                               
                             
                           
                           ) 
                         
                          
                         
                           Z 
                           1 
                         
                          
                         
                           Z 
                           2 
                         
                          
                         
                           C 
                           0 
                         
                       
                       + 
                     
                   
                 
                 
                   
                     
                       
                         
                           ( 
                           
                             
                               Δ 
                                
                               
                                   
                               
                                
                               y 
                                
                               
                                   
                               
                                
                               Δ 
                                
                               
                                   
                               
                                
                               
                                 X 
                                 20 
                               
                             
                             - 
                             
                               Δ 
                                
                               
                                   
                               
                                
                               x 
                                
                               
                                   
                               
                                
                               Δ 
                                
                               
                                   
                               
                                
                               
                                 Y 
                                 20 
                               
                             
                           
                           ) 
                         
                          
                         
                           ( 
                           
                             
                               
                                 Z 
                                 0 
                               
                                
                               
                                 Z 
                                 2 
                               
                                
                               
                                 C 
                                 1 
                               
                             
                             - 
                             
                               
                                 Z 
                                 1 
                               
                                
                               
                                 Z 
                                 2 
                               
                                
                               
                                 C 
                                 0 
                               
                             
                           
                           ) 
                         
                       
                       + 
                     
                   
                 
                 
                   
                     
                       
                         ( 
                         
                           
                             Δ 
                              
                             
                                 
                             
                              
                             x 
                              
                             
                                 
                             
                              
                             Δ 
                              
                             
                                 
                             
                              
                             
                               Y 
                               10 
                             
                           
                           - 
                           
                             Δ 
                              
                             
                                 
                             
                              
                             y 
                              
                             
                                 
                             
                              
                             Δ 
                              
                             
                                 
                             
                              
                             
                               X 
                               10 
                             
                           
                         
                         ) 
                       
                        
                       
                         ( 
                         
                           
                             
                               Z 
                               0 
                             
                              
                             
                               Z 
                               1 
                             
                              
                             
                               C 
                               2 
                             
                           
                           - 
                           
                             
                               Z 
                               1 
                             
                              
                             
                               Z 
                               2 
                             
                              
                             
                               C 
                               0 
                             
                           
                         
                         ) 
                       
                     
                   
                 
               
               
                 
                   
                     
                       
                         
                           ( 
                           
                             
                               Δ 
                                
                               
                                   
                               
                                
                               
                                 X 
                                 20 
                               
                                
                               Δ 
                                
                               
                                   
                               
                                
                               
                                 Y 
                                 10 
                               
                             
                             - 
                             
                               Δ 
                                
                               
                                   
                               
                                
                               
                                 Y 
                                 20 
                               
                                
                               Δ 
                                
                               
                                   
                               
                                
                               
                                 X 
                                 10 
                               
                             
                           
                           ) 
                         
                          
                         
                           Z 
                           1 
                         
                          
                         
                           Z 
                           2 
                         
                       
                       + 
                     
                   
                 
                 
                   
                     
                       
                         
                           ( 
                           
                             
                               Δ 
                                
                               
                                   
                               
                                
                               y 
                                
                               
                                   
                               
                                
                               Δ 
                                
                               
                                   
                               
                                
                               
                                 X 
                                 20 
                               
                             
                             - 
                             
                               Δ 
                                
                               
                                   
                               
                                
                               x 
                                
                               
                                   
                               
                                
                               Δ 
                                
                               
                                   
                               
                                
                               
                                 Y 
                                 20 
                               
                             
                           
                           ) 
                         
                          
                         
                           ( 
                           
                             
                               
                                 Z 
                                 0 
                               
                                
                               
                                 Z 
                                 2 
                               
                             
                             - 
                             
                               
                                 Z 
                                 1 
                               
                                
                               
                                 Z 
                                 2 
                               
                             
                           
                           ) 
                         
                       
                       + 
                     
                   
                 
                 
                   
                     
                       
                         ( 
                         
                           
                             Δ 
                              
                             
                                 
                             
                              
                             x 
                              
                             
                                 
                             
                              
                             Δ 
                              
                             
                                 
                             
                              
                             
                               Y 
                               10 
                             
                           
                           - 
                           
                             Δ 
                              
                             
                                 
                             
                              
                             y 
                              
                             
                                 
                             
                              
                             Δ 
                              
                             
                                 
                             
                              
                             
                               X 
                               10 
                             
                           
                         
                         ) 
                       
                        
                       
                         
                           ( 
                           
                             
                               
                                 Z 
                                 0 
                               
                                
                               
                                 Z 
                                 1 
                               
                             
                             - 
                             
                               
                                 Z 
                                 1 
                               
                                
                               
                                 Z 
                                 2 
                               
                             
                           
                           ) 
                         
                         .

BACKGROUND

1. Technical Field

The present invention relates to the technical field of graphicrendering and, in particular, to a rasterizing method for finding andrendering all the pixels of the screen associated with a primitive.

2. Description of the Related Art

A virtual three dimensional (3D) model (or simply “3D model”) iscomprised of primitives in the form of polygons, such as triangles,which represent the skin of the 3D model. A graphic 3D engine drawspolygons from the 3D model onto a two-dimensional (2D) surface, such asa screen.

A summary of the prior art rendering process can be found in:“Fundamentals of Three-Dimensional Computer Graphics”, by Watt, Chapter5: The Rendering Process, pages 97 to 113, published by Addison-WesleyPublishing Company, Reading, Mass., 1989, reprinted 1991, ISBN0-201-15442-0.

In a traditional pipeline, the primitives are processed in a submissionorder. A more efficient method is to break up the frame buffer intoindividual subsections (tiles) and to render them individually. Eachtile includes one or more polygons or, more typically, a portion of oneor more polygons.

A tile based rendering employs therefore a way to associate tilescovered by a primitive. A rasterizer renders all primitives of one tile,so which tile is covered by that primitive is found first.

To reduce the amount of tiles that each polygon is assigned to, aprimitive or polygon binning method may be used. A polygon binningmethod excludes tiles that do not include any polygons or portionsthereof prior to rasterization. The binning process also accomplishessome rasterization setup by identifying which polygons are contained byeach tile.

The rasterizing process comprises receiving the vertices of a primitive,finding all the pixels associated with the primitive, and rendering allthe pixels. Rendering implies associating with each pixel a set ofattributes. The attributes are data (color, coordinates position,texture coordinate etc.) associated with a primitive. Starting from theattributes of the vertices of a primitive, the rasterizer finds theattributes of each pixel by interpolation.

Some kinds of rasterizers are already known.

One of the most used rasterizers is known as Bresenham. Starting from atriangle vertex, it uses an incremental technique which finds borderpixels using the Bresenham scan line.

Another approach is known as RLI. Also this method always starts from atriangle vertex and uses another scan line technique to find borderpixels.

This is an incremental technique that reduces the possibility to have ahigh parallelism. It calculates all attributes using deltax, deltay,deltaz coordinates of the current pixels. The calculation attribute isincremental, so it saves a lot of operations compared to the Bresenham.However, the rendering direction is not flexible.

A further approach is known as Homogeneus, because all calculations areperformed into homogeneous space (defined by x, y, z, w coordinates). Itdoes not use a scan line technique to find border pixels but it makes atest location based on an edge equation. It can start from any point forrendering, and it can calculate all attributes using deltax, deltay,deltaz coordinates of the current pixel. However, since all calculationsare made into homogeneous space, this technique requires morecomputation then RLI.

There is therefore the need of rendering pixels in a more efficient way,in order to reduce the amount of processing to be performed by the 3Dgraphic engine.

BRIEF SUMMARY

One embodiment of the present invention provides a rasterizing method,comprising:

calculating an attribute (C) of a pixel having coordinates (X, Y),knowing the coordinates (X₀, Y₀), (X₁, Y₁), (X₂, Y₂) of the vertices ofa primitive into screen space, the Z coordinates Z₀, Z₁ and Z₂ of saidvertices into the three-dimensional space, and attributes C₀, C₁, C₂ ofsaid vertices, the calculating including:

defining a vertex (X₀, Y₀) as reference,

finding H coefficients

H ₀=(ΔX ₂₀ ΔY ₁₀ −ΔY ₂₀ ΔX ₁₀)Z ₁ Z ₂ C ₀

H ₁ =−ΔY ₂₀(Z ₀ Z ₂ C ₁ −Z ₁ Z ₂ C ₀)+ΔY ₁₀(Z ₀ Z ₁ C ₂ −Z ₁ Z ₂ C ₀)

H ₂ =ΔX ₂₀(Z ₀ Z ₂ C ₁ −Z ₁ Z ₂ C ₀)−ΔX ₁₀(Z ₀ Z ₁ C ₂ −Z ₁ Z ₂ C ₀)

H ₃=(ΔX ₂₀ ΔY ₁₀ −ΔY ₂₀ ΔX ₁₀)Z ₁ Z ₂

H ₄ =−ΔY ₂₀(Z ₀ Z ₂ −Z ₁ Z ₂)+ΔY ₁₀(Z ₀ Z ₁ −Z ₁ Z ₂)

H ₅ =ΔX ₂₀(Z ₀ Z ₂ −Z ₁ Z ₂)−ΔX ₁₀(Z ₀ Z ₁ −Z ₁ Z ₂)

wherein ΔX_(ij)=X_(i)−X_(j) and ΔY_(ij)=Y_(i)−Y_(j),

calculating attribute C using the formula:

$c = \frac{H_{0} + {H_{1}\Delta \; x} + {H_{2}\Delta \; y}}{H_{3} + {H_{4}\Delta \; x} + {H_{5}\Delta \; y}}$

wherein ×x=X−X₀ and Δy=Y−Y₀.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

The features and advantages of the method according to variousembodiment of the invention will be apparent from the description givenbelow, with reference to the following figures, in which:

FIG. 1 shows a graphic system in accordance with one embodiment of theinvention;

FIG. 2 shows an example of graphic module in accordance with oneembodiment of the invention;

FIG. 3 shows an example of a part of the graphic module in mode detail;

FIG. 4 shows an example of a geometry stage employable in said graphicmodule;

FIG. 5 shows an intersection between a frustum and the screen;

FIG. 6 represents a bounding box around a triangle according to oneembodiment of the invention;

FIGS. 7 and 8 schematically illustrate the step of determining thecoefficients sign of the edge equations according to one embodiment;

FIGS. 9 a and 9 b show a triangle in eye space and into screen space,respectively; and

FIGS. 10 a-10 d schematically shows different steps of a parallelrendering.

DETAILED DESCRIPTION

FIG. 1 shows a graphic system according to an embodiment of theinvention and comprising a graphic module 500 (GR-MOD). The graphicsystem 100 illustrated in FIG. 1 is a mobile phone, but in accordancewith further embodiments of the invention, graphic system 100 can beanother system such as a personal digital assistant (PDA), a computer(e.g., a personal computer), a game console (e.g., PlayStation), etc.

As an example, the mobile phone 100 can be a cellular phone providedwith an antenna 10, a transceiver 20 (Tx/Rx) connected with the antenna10, an audio circuit unit 30 (AV-CIRC) connected with the transceiver20. A speaker 40 and a microphone 90 are connected with the audiocircuit unit 30.

The mobile phone 100 is further provided with a CPU (Central ProcessingUnit) 60 for controlling various functions and, particularly, theoperation of the transceiver 20 and the audio circuit unit 30 accordingto a control program stored in a system memory 80 (MEM), connected tothe CPU 60. Graphic module 500 is coupled to and controlled by the CPU60. Moreover, mobile phone 100 is provided with a display unit 70provided with a corresponding screen 71 (e.g., a liquid crystal display,DSPY), and a user interface 50, such as an alphanumeric keyboard (K-B).

The graphic module 500 is configured to perform a set of graphicfunctions to render an image on the screen 71 of the display 70. In oneembodiment, the graphic module 500 is a graphic engine configured torender images, offloading the CPU 60 from performing such tasks. In oneembodiment of the present invention the term “graphic engine” means adevice which performs rendering in hardware. The terms “graphicaccelerator”, also employed in the field, is equivalent to the termgraphic engine.

Alternatively, the graphic module 500 can be a graphic processing unit(GPU) wherein the rendering functions are performed on the basis ofhardware and software instructions. In accordance with a furtherembodiment, some or all of the rendering functions are performed by theCPU 60.

In FIG. 2 a diagram of the graphic module 500, is shown by means offunctional blocks. Graphic engine 500 can perform the rendering of 3D(three dimensional) scenes that are displayed on the screen 71 of thedisplay 70. According to one embodiment, the graphic engine 500 canoperate according to a sort-middle rendering approach (also called “tilebased” rendering).

In accordance with the sort-middle rendering, the screen 71 of thedisplay 70 is divided in a plurality of 2D (two dimensional) orderedportions (i.e., 2D tiles) such as, for example, square tiles 5 as shownin FIG. 7. As an example, the screen is divided into 2D tiles havingsize 16×16 pixels or 64×64 pixels.

The graphic engine 500, illustrated in FIG. 2, comprises a driver 501, ageometry stage 502 (also known as TnL stage—Transform and Lightingstage) a binner stage 503 and a parser stage 506.

The driver 501 is a block having interface tasks and is configured toaccept commands from programs (e.g., application protocol interface—API)running on the CPU 60 and then translate them into specialized commandsfor the other blocks of the graphic engine 500.

The geometry stage 502 is configured to process primitives and apply tothem transformations so as to move 3D objects. As defined above, aprimitive is a simple geometric entity such as, e.g., a point, a line, atriangle, a square, a polygon or high-order surface. In the followingreference will be made to triangles, which can be univocally defined bythe coordinates of their vertexes, without other types of employableprimitives.

The binner stage 503 is adapted to acquire from the geometry stage 502primitive coordinates and associate them to each tile of the screen 71.The binner stage 503 is coupled to a scene buffer 504 which is a memoryable to store information provided by the binner stage 503. As anexample, the scene buffer 504 is a memory external to the graphic module500 and can be the memory system 80 illustrated in FIG. 1.

The graphic module 500 further includes a parser stage 506, a rasterizerstage 507 and a fragment processor 508 which is coupled to the display70. The parser stage 506 is responsible for reading, for each tile, theinformation stored in the scene buffer 504 and passing such informationto the following stages also performing a primitive reorderingoperation.

The parser stage 506 generates an ordered display list which is stored,temporarily, in a parser side memory 509. The parser stage 506 issuitably coupled to the scene buffer memory 504 in order to read itscontent and is coupled to the binner stage 503 to receivesynchronization signals.

According to one embodiment, the parser side memory 509 may be anon-chip memory, which allows a fast processing. As an example, theparser side memory 509 is integrated on the same chip on which theparser stage 506 has been integrated and, e.g., shows a capacity of 8kB.

The rasterizer stage 507 is configured to perform processing ofprimitive data received from the parser stage 506 so as to generatepixel information images such as the attribute values of each pixel. Theattributes are data (color, coordinates position, texture coordinateetc.) associated with a primitive. As an example, a triangle vertex hasthe following attributes: color (R, G, B, A), position, coordinatesassociated to texture (S, T, Q) and Fog. As is known to the skilledperson, a texture is an image (e.g., a bitmap image) that could bemapped on the primitive.

The fragment processor 508 defines fragments from the received pixels,by associating a fragment depth (Z coordinate) with pixels and otherdata and performing suitable tests on the received pixels.

A method for interpolating the attributes of the pixels associated witha primitive in the form of a triangle, given the attributes of itsvertices, will be described later.

FIG. 3 shows an embodiment of the graphic module 500, wherein the binnermodule 503 and the rasterizer module 507 are disclosed in more detail.This architectural scheme is developed to work effectively in any 3Dhardware (HW) accelerated graphics pipeline. In particular, the module500 shown in FIG. 3 is oriented towards the integration into the NomadikPlatform (in particular the 8820 version), but it could be easily fittedinto any real system that needs an HW accelerated 3D engine. Accordingto one embodiment, binner module 503 includes a border tiles detectionmodule 519 suitable to perform a tiles edge detection process, ageometry stage loader 520, a binner edge bounding box 521, which createsa bounding box around each primitive, and a tile pointer list builder522. The tile pointer list builder 522 builds the list of commands foreach tile. Such commands can be pointers to contexts (for example, fogenable, blending enable, buffer format, etc.) or pointers to primitivesthat cross the tiles, detected by the corner/edge detection module 519.Afterwards, the graphic engine will read the sequence of commands ofeach tile, in order to rasterize the scene tile by tile.

According to one embodiment, rasterizer module 507 may include a borderpixels detection module 519′ suitable to perform a pixels edge detectionprocess, for example according to the method used for the border tilesdetection.

FIG. 4 shows an embodiment of the geometry stage 502 which includes atransformations stage 550. The transformations stage 550 is configuredto apply geometric transformations to vertices of the primitives in eachsingle object of the scene to transform primitives from a user space toa screen space. As an example, transformations are of the affine typeand defined in an affine space where two entities are defined: pointsand vectors. Results of transformation are vectors or points.

Moreover, the particular geometry stage 502 described comprises: alighting stage 551, a primitive assembly stage 552, a clipping stage553, a “perspective divide” stage 554, a viewport transformation stage555 and a culling stage 556.

The per-vertex lighting stage 551 applies light to the primitivesdepending on a defined light source and suitably adjusts the primitivecolor vertexes in such a way to define the effect of the light. Theprimitive assembly stage 552 is a stage that allows reconstruction ofthe semantic meaning of a primitive so as to specify the primitive type,i.e., specifying if a primitive is a triangle, a line or a point and soon.

The clipping stage 553 allows removal of the primitives that are outsidethe screen 71 (non-visible primitives) and converting the primitivesthat are placed partially out of the screen 71 into primitives which arefully visible. The perspective divide stage 554 is adapted to apply aprojective transformation dividing each coordinate value by a vector w.

The viewport transformation stage 555 is configured to apply a furthercoordinates transformation which takes into account the screenresolution. The culling stage 556 has the task of removing theprimitives oriented in a direction opposite to the observer and itsoperation is based on a normal direction associated with each primitive.

In operation, the user of the mobile phone 100 employs the keyboard 50in order to select a 3D graphic application, such as a video game. As anexample, such graphic application allows to show on the screen 71several scenes. The scenes correspond to what is visible for an observerwho can move assuming different positions. Accordingly, a softwaremodule corresponding to said graphic application runs on the CPU 60 andactivates the graphic module 500.

A 3D scene to be rendered is included in a region of space, called viewfrustum VF (FIG. 5), which is the observer visible space. In FIG. 5,only a plane portion of the view frustum VF parallel to the screen 71 isshown. The clipping module 503 has the task to find said intersectionbetween the screen 71 and the frustum VF.

According to one embodiment, the binner stage 503 associates empty tileswith the triangle to avoid redundant rasterizer calculations. It isclear that, if triangles are smaller then tiles, the binner stage 503processes all triangles within each tile before proceeding to the nexttile. If the triangles are larger than tiles, it associates thetriangles with all the tiles they cross and stores the state. In thiscase, an exploration of the tiles is carried out.

According to one embodiment, the binner module 503 is adapted to detectthe tiles crossed by the edges of a triangle (border tiles). All thetiles between two border tiles on the same row or column are thenconsidered included in the primitive and may therefore be stored.

An example of a method for detecting the border tiles of a primitivedefined by at least three vertexes is disclosed in the U.S. patentapplication Ser. Nos. 11/838,762 and 11/951,186, incorporated herein byreference, in their entirety.

The rasterizer module 507 is the core of a 3D pixel engine. It receivesthe vertices V₀=(x₀, y₀), V₁=(x₁, y₁) and V₂=(x₂, Y₂) of a primitive inthe form of a triangle 6 defined by three vertexes. It has to be noted,however, that the rasterizing method here described is also applicableto other polygons, since it is always possible to decompose a polygon intriangles. Moreover, rasterizing module 507 knows the attributes C (forexample colors, texture, fog) and the Z coordinate of the vertices.

According to one embodiment, the rasterizing method performed byrasterizing module 507 comprises three phases: a set-up phase, in whichall the parameters in common to all the pixels of the same primitive arecalculated, a test location phase, in which pixels associated to aprimitive are detected (border pixels and internal pixels), and anattributes interpolation phase, in which the attributes of all thepixels detected in the second phase are calculated.

According to one embodiment, the rasterizing module 507 is able tocalculate an attribute C from an absolute point of the screen by meansof the following formula with perspective correction:

$C = \frac{\begin{matrix}{{\left( {{\Delta \; X_{20}\Delta \; Y_{10}} - {\Delta \; Y_{20}\Delta \; X_{10}}} \right)Z_{1}Z_{2}C_{0}} +} \\{{\left( {{\Delta \; y\; \Delta \; X_{20}} - {\Delta \; x\; \Delta \; Y_{20}}} \right)\left( {{Z_{0}Z_{2}C_{1}} - {Z_{1}Z_{2}C_{0}}} \right)} +} \\{\left( {{\Delta \; x\; \Delta \; Y_{10}} - {\Delta \; y\; \Delta \; X_{10}}} \right)\left( {{Z_{0}Z_{1}C_{2}} - {Z_{1}Z_{2}C_{0}}} \right)}\end{matrix}}{\begin{matrix}{{\left( {{\Delta \; X_{20}\Delta \; Y_{10}} - {\Delta \; Y_{20}\Delta \; X_{10}}} \right)Z_{1}Z_{2}} +} \\{{\left( {{\Delta \; y\; \Delta \; X_{20}} - {\Delta \; x\; \Delta \; Y_{20}}} \right)\left( {{Z_{0}Z_{2}} - {Z_{1}Z_{2}}} \right)} +} \\{\left( {{\Delta \; x\; \Delta \; Y_{10}} - {\Delta \; y\; \Delta \; X_{10}}} \right)\left( {{Z_{0}Z_{1}} - {Z_{1}Z_{2}}} \right)}\end{matrix}}$

where:

(X₀,Y₀), (X₁,Y₁), and (X₂,Y₂) are the vertices coordinates into screenspace;

Z₀, Z₁, Z₂ are Z coordinates into 3d space as z buffer;

C₀, C₁, C₂ are vertex attributes;

(x,y) are coordinates of a point into screen space,

and where Δx=X−X₀ and Δy=Y−Y₀ are the difference between the genericpoint of the screen space and a vertex chosen as reference, for exampleV₀=(X₀, Y₀).

Besides, rasterizer module 507 calculates also the Z coordinate as

$Z = \frac{Z_{0}Z_{1}Z_{2}}{\begin{matrix}{{\left( {{\Delta \; X_{20}\Delta \; Y_{10}} - {\Delta \; Y_{20}\Delta \; X_{10}}} \right)Z_{1}Z_{2}} +} \\{{\left( {{\Delta \; y\; \Delta \; X_{20}} - {\Delta \; x\; \Delta \; Y_{20}}} \right)\left( {{Z_{0}Z_{2}} - {Z_{1}Z_{2}}} \right)} +} \\{\left( {{\Delta \; x\; \Delta \; Y_{10}} - {\Delta \; y\; \Delta \; X_{10}}} \right)\left( {{Z_{0}Z_{1}} - {Z_{1}Z_{2}}} \right)}\end{matrix}}$

It should be noted that Z has the same denominator of the previousformula, and that these calculations are carried out only once for theprimitive, in the set-up phase.

Now the attribute calculation leading to the previous formulae will beexplained starting from the data of the vertices of a triangle.

The attribute calculation is linear into eye space and then becomes notlinear into screen space by virtue of the division by the homogeneouscoordinate “w”.

In FIG. 9 a it is shown a triangle into eye space having vertices P′a,P′b and P′c. P′ is a generic point inside the triangle. In FIG. 9 b itis shown the same triangle but into screen space, after perspectivetransformation. The vertices of this triangle are Pa, Pb and Pc. P isthe generic point inside the triangle.

Into eye space a point P′ is given by the linear combination of verticesP′a, P′b, P′c:

P′=a′*P′a+b′*P′b+c′*P′c,

where a′, b′ and c′ are the portions of triangle area built from P′point to triangle edges.

The triangle area is normalized by default, so the value is one. Itmeans that the sum of all areas gives one.

1=a′+b′+c′.

The same consideration is valid also for screen space.

Into screen space a point P is given by the linear combination ofvertices Pa, Pb, Pc:

P=a*Pa+b*Pb+c*Pc,

where a, b and c are the portions of triangle area built from P point totriangle edges.

The triangle area is normalized by default, so the value is one. Itmeans that the sum of all areas gives one.

1=a+b+c.

The attribute calculation is linear only into eye space.

C=a′*Ca+b′*Cb+c′*Cc,

where Ca, Cb and Cc are the attributes associated to vertices oftriangle.

Each eye point is transformed into screen point by the matrix transformand then divided by w.

$\begin{matrix}{P = \frac{P^{\prime}*M}{w}} & (1)\end{matrix}$

where M is the fusion between model view and projection matrix and w isthe homogeneous coordinate.

Applying the transformation on eye point P′, it is possible to write:

$\begin{matrix}{P = \frac{P^{\prime}*M}{w}} \\{= \frac{\left( {{a^{\prime}*P^{\prime}a} + {b^{\prime}*P^{\prime}b} + {c^{\prime}*P^{\prime}*c}} \right)*M}{w}} \\{= {\frac{a^{\prime}*P^{\prime}a*M}{w} + \frac{b^{\prime}*P^{\prime}b*M}{w} + {\frac{c^{\prime}*P^{\prime}c*M}{w}.}}}\end{matrix}$

For each triangle vertex the relation (1) is true, so the screen vertexpoints are the following:

${P\; a} = {{\frac{P^{\prime}a*M}{w_{a}}\mspace{11mu} P\; b} = {{\frac{P^{\prime}b*M}{w_{b}}\mspace{11mu} P\; c} = {\frac{P^{\prime}c*M}{w_{c}}.}}}$

It is possible to replace them into previous formula:

$P = {\frac{P^{\prime}*M}{w} = {\frac{a^{\prime}*P\; a*w_{a}}{w} + \frac{b^{\prime}*{Pb}*w_{b}}{w} + {\frac{c^{\prime}*{Pc}*w_{c}}{w}.}}}$

That equation must be equal to P=a*Pa+b*Pb+c*Pc.

The coefficients of Pa, Pb and Pc must be equal. Consequently, thescreen areas are equivalent to eye areas in the following way:

$\begin{matrix}{a = {{\frac{a^{\prime}*w_{a}}{w}\mspace{11mu} b} = {{\frac{b^{\prime}*w_{b}}{w}\mspace{11mu} c} = {\frac{c^{\prime}*w_{c}}{w}.}}}} & (2)\end{matrix}$

It means that it is possible to find attributes with screen area insteadof eye area:

$C = {\left( {\frac{a^{*}{Ca}}{w_{a}} + \frac{b*{Cb}}{w_{b}} + \frac{c*{Cc}}{w_{c}}} \right)*{w.}}$

W is not yet known, but there is a relation between eye areas:

1=a′+b′+c′.

Replacing in equation 2), it is possible to find w:

$\begin{matrix}{w = {\frac{1}{\left( {\frac{a}{w_{a}} + \frac{b}{w_{b}} + \frac{c}{w_{c}}} \right)}.}} & (3)\end{matrix}$

Finally, it is possible to calculate attributes without eye coordinates:

$\begin{matrix}{C = {\frac{\left( {\frac{a*{Ca}}{w_{a}} + \frac{b*{Cb}}{w_{b}} + \frac{c*{Cc}}{w_{c}}} \right)}{\left( {\frac{a}{w_{a}} + \frac{b}{w_{b}} + \frac{c}{w_{c}}} \right)}.}} & (4)\end{matrix}$

At the end it is possible to introduce the edge equation

E=x(y ₁ −y ₀)−y(x ₁ −x ₀)−x ₀(y ₁ −y ₀)−y ₀(x ₁ −x ₀)=a _(x) +b _(y) +c.

Since it is known that the edge equation is exactly the double area of atriangle having two vertices defining the edge E and a point outside theedge as the third vertex, and since areas a, b, c are normalized, theirvalues are the following:

${a = \frac{Ebc}{\left( {{Ebc} + {Eab} + {Eac}} \right)}};$${b = \frac{Eac}{\left( {{Ebc} + {Eab} + {Eac}} \right)}};$$c = {\frac{Eab}{\left( {{Ebc} + {Eab} + {Eac}} \right)}.}$

Hence it is possible to write the interpolation (4) with the edgeequation:

$C = {\frac{\begin{pmatrix}{{{Ebc}*w_{b}*w_{c}*{Ca}} + {{Eac}*w_{a}*}} \\{{w_{c}*{Cb}} + {{Eab}*w_{a}*w_{b}*{Cc}}}\end{pmatrix}}{\left( {{{Ebc}*w_{b}*w_{c}} + {{Eac}*w_{a}*w_{c}} + {{Eab}*w_{a}*w_{b}}} \right)}.}$

By expressing each edge equation E in function of the correspondingvertex coordinates, and taking into account that, in the perspectivetransformation, w=−z, the starting formula for attribute C is obtained.

The formula for Z coordinate is derivable from relation (3).

Therefore, it is possible to evaluate directly the attribute with anypoint, directly in the screen space[.

According to one embodiment, the previous formulae can be expressed inthe form

$C = \frac{H_{0} + {H_{1}\Delta \; x} + {H_{2}\Delta \; y}}{H_{3} + {H_{4}\Delta \; x} + {H_{5}\Delta \; y}}$$Z = \frac{Z_{0}Z_{1}Z_{2}}{H_{3} + {H_{4}\Delta \; x} + {H_{5}\Delta \; y}}$

where the coefficients H₀-H₅ are:

H ₀=(ΔX ₂₀ ΔY ₁₀ −ΔY ₂₀ ΔX ₁₀)Z ₁ Z ₂ C ₀

H ₁ =−ΔY ₂₀(Z ₀ Z ₂ C ₁ −Z ₁ Z ₂ C ₀)+ΔY ₁₀(Z ₀ Z ₁ C ₂ −Z ₁ Z ₂ C ₀)

H ₂ =ΔX ₂₀(Z ₀ Z ₂ C ₁ −Z ₁ Z ₂ C ₀)−ΔX ₁₀(Z ₀ Z ₁ C ₂ −Z ₁ Z ₂ C ₀)

H ₃=(ΔX ₂₀ ΔY ₁₀ −ΔY ₂₀ ΔX ₁₀)Z ₁ Z ₂

H ₄ =ΔY ₂₀(Z ₀ Z ₂ −Z ₁ Z ₂)+ΔY ₁₀(Z ₀ Z ₁ −Z ₁ Z ₂)

H ₅ =ΔX ₂₀(Z ₀ Z ₂ −Z ₁ Z ₂)−ΔX ₁₀(Z ₀ Z ₁ −Z ₁ Z ₂)

The triangle set-up phase therefore computes 30 sums and 41multiplications per primitive and per attribute. However it is possibleto reduce the number of operations by introducing temporally variables:

T₀=Z₁Z₂

T₁=Z₀Z₂

T₂=Z₀Z₁

T₃=T₀C₀

T₄=T₁C₁

T₅=T₂C₂

T ₆ =T ₁ −T ₀

T ₇ =T ₂ −T ₀

T ₈ =T ₄ −T ₃

T ₉ =T ₅ −T ₃

T ₁₀ =ΔX ₂₀ ΔY ₁₀ −ΔY ₂₀ ΔX ₁₀.

Therefore the H coefficients become:

H₀=T₁₀T₃

H ₁ =−ΔY ₂₀ T ₈ +ΔY ₁₀ T ₉

H ₂ =ΔX ₂₀ T ₈ −ΔX ₁₀ T ₉

H₃=T₁₀T₀

H ₄ =−ΔY ₂₀ T ₆ +ΔY ₁₀ T ₇

H ₅ =ΔX ₂₀ T ₆ −ΔX ₁₀ T ₇

Hence, the triangle set up computes 21 sums and 18 multiplications perprimitive and per attribute.

Advantageously, the denominator is the same for any attributes, so onedoes not need to calculate more than the numerator for each attribute.

According to one embodiment, the attributes are R,G,B,A (colorattributes), S,T,Q (texture attributes) and Fog. Z does not require morethat the calculation of the numerator. The attributes are 8+Zcoordinate. Therefore, triangle set up computes 84 sums and 68multiplications per primitive.

Test Location Phase

According to one embodiment, to detect internal pixels of a primitive,the rasterizing module 507 uses techniques based on edge equation intoscreen space.

To verify if a point is inside or outside of a primitive, it isnecessary to test the sign of the edge equation. For each couple ofvertices, the equation of the line passing through the vertexes iscalculated in the form of the following edge equation:

E=x(y ₁ −y ₀)−y(x ₁ −x ₀)−x ₀(y ₁ −y ₀)−y ₀(x ₁ −x ₀)=ax+by+c.

Any point on the line will satisfy this equation; points not belongingto the line and placed on one side will give a positive result, whilepoints not belonging to the line and placed on the other side will givea negative result. Therefore, the edge equation can be used to determineon which side of a line a point is placed.

The three edge equations of a triangle will be:

E ₀ =x(y ₁ −y ₀)−y(x ₁ −x ₀)−x ₀(y ₁ −y ₀)−y ₀(x ₁ −x ₀)=a ₀₁ x+b ₀₁ y+c₀₁

E ₁ =x(y ₂ −y ₀)−y(x ₂ −x ₀)−x ₀(y ₂ −y ₀)−y ₀(x ₂ −x ₀)=a ₀₂ x+b ₀₂ y+c₀₂

E ₂ =x(y ₁ −y ₂)−y(x ₁ −x ₂)−x ₂(y ₁ −y ₂)−y ₂(x ₁ −x ₂)=a ₂₁ x+b ₂₁ y+C₂₁.

The rasterizing module 507 then defines if an edge is left or right.According to one embodiment of the invention, for determining if an edgeis left or right, the rasterizing module 507:

-   -   selects a reference edge between two vertexes;    -   tests the sign of the reference edge equation for the third        vertex, and:        -   if the sign is positive, marks the reference edge as a left            edge;        -   if the sign is negative, marks the reference edge as a right            edge.

As an example, the rasterizing module 507 selects as reference edge theedge with the maximum Δy, i.e., the edge showing the maximum value ofthe difference between the y coordinates of the corresponding vertexes.In this case, the third vertex is a middle vertex, along the y axis.

As stated above, to verify if a point is inside or outside a primitive,the sign of the edge equation may be tested. The line equation could beax+by+c=0 or −ax −by−c=0, so the sign of the edge equation depends onthe sign of the coefficients. According to one embodiment, it is betterto have always an internal point with a positive edge equation for alledges, so it is not necessary to change sign of edge equation everytime. In other words, the coefficients sign of the edge equation of theleft and right edges is chosen such that the results of the edgeequations for a point falling between the left and right edges have thesame sign.

Then it is sufficient to follow a clockwise direction to define the signof coefficient.

With reference to FIGS. 7, 8, if E₀ is the reference edge and V₂ themiddle vertex, if the corresponding edge equation evaluated for V₂ givesa positive result, E₀(V₂)>0, then the middle vertex is right and thesign of a₂₁, b₂₁, c₂₁ and a₀₂, b₀₂, c₀₂ may be changed to have aninternal point with E₀, E₁, E₂ positive (FIG. 7).

If E₀(V₂)<0, then the middle vertex is left and the sign of a₀₁, b₀₁,c₀₁ may be changed to have an internal point with E₀, E₁, E₂ positive(FIG. 8).

A winding equation (cross product between two vectors) gives the sameresult as the edge equation, so they are equivalent.

It should be noted that, in a tile-based rendering system, for examplein a sort-middle technique, many parameters used by the rasterizingmodule 507, for example the coefficients of the edge equations and thetop and bottom values of a primitive, are already available to therasterizing module 507 since they have already been calculated by thebinner module 503 for constructing the bounding box around a primitiveand detecting the tiles associated to the primitive. A tile-basedrendering system is for example disclosed in U.S. patent applicationSer. Nos. 11/838,762 and 11/951,186, incorporated herein by reference,in their entirety.

According to one approach, the rasterizing module 507 finds the borderpixels of the primitive, calculates the attributes of the border pixelsand then, for example by working per pixel rows or columns,incrementally calculates the attributes of each internal pixel.

According to one embodiment, the rasterizer module 507 splits a trianglein two parts, bottom and top triangles created by the middle vertex. Inthis way, the rasterizer module 507 works starting from left to rightedge to render the pixel row, without changing edge and relative partialattribute derivates.

A method for finding the border pixels is for example described in theabove cited U.S. application Ser. No. 11/951,186.

According to this approach, the above described operations in the set-upphase are not necessary for non-border pixels, while for the internalpixels it is possible to use a differential formula, moving in the samerow or column by adjacent pixels.

For example, if an attribute C=C_(num)/C_(den) (C_(num) being thenumerator of the C equation and C_(den) being the denominator), movingby rows, that is maintaining y constant, we have that

C _(numi+1) =C _(numi) +H ₁ and C _(deni+1) =C _(deni) +H ₄

that is, 2 sums per attribute and 1 division per fragment.

Maintaining x constant (i.e., by moving by columns):

C _(numi+1) =C _(numi) +H ₂

and

C _(deni+1) =C _(deni) +H ₅.

It is however possible to use the differential formula for anydirection:

C _(numi+1) =C _(numi) +H ₁ Δx _(i) +H ₂ Δy _(i)

and

C _(den+1) =C _(den) +H ₄ Δx _(i) +H ₅ Δy _(i).

It should be noted that, in a tile-based rendering system, during tileassociation with a primitive, a point inside the triangle edge isgenerated as a starting point. This point could also be used as a goodstarting point for pixel rendering into screen space.

Parallelism

The possibility given by the rasterizing method of calculating theattributes of any point of the screen, without necessarily starting froma vertex, allows to apply in parallel the calculation of all pixelattributes.

For example, the bounding box around the primitive could be divided in aplurality of sub-rectangles which can be processed in parallel, forexample by rows, by respective rasterizer modules 507.

According to one embodiment, it would be preferable to implement arendering strategy to balance to load of N rasterizers. In fact, a rowcould be shorter than another, so a rasterizer could finish its workearly and another one later. A good solution could be to give a new rowto the first rasterizer that finishes its row. The new row should be thelongest remained, so that when the last rasterizer finishes its row, itcould start with a smaller one. In this way the N rasterizers shouldterminate their work almost at the same time.

For example, with reference to FIGS. 10 a-10 d, in a first step a firstgroup of border pixels BP′ are found, for example using the methoddisclosed in U.S. patent application Ser. No. 11/951,186.

In a second step, the found border pixels BP′ are rendered in parallelwith respective rasterizer modules, using the general formula forattribute C and Z coordinate. In the meantime, a second group of otherborder pixels BP″ are found.

In a third step, the internal pixels IP′ on the same rows of the firstborder pixels BP′ are rendered in parallel with respective rasterizermodules, using the differential formula with y constant. The rasterizersassociated to the shortest rows, the upper ones R₁ and R₂ in theexample, finish their rendering earlier than the rasterizer modulesassociated to longer rows R3, R4. Therefore, the first rasterizermodules can restart with the longest rows R5, R6. They will apply thegeneral formula for the border pixels BP″ and then the differentialformula for the internal pixels IP″.

In a fourth step, the rasterizers associated to the longest rows R3, R4finish their work. Therefore, these rasterizer modules can restart withthe remaining rows R7, R8. They will apply the general formula for theborder pixels BP″ and then the differential formula for the internalpixels IP″.

At the end of rendering phase, some rasterizer modules may finishearlier because the number of row could be different. In that case, freerasterizers can help busy rasterizers to complete their row.

In any case, the rasterizing method does not require more than a minimumnumber of operations, and it offers the possibility to have a highparallelism and a flexible rendering direction. In particular, in theset-up phase, it does not need divisions by w-coordinate as RLI andHomogeneous techniques.

All the calculations are made into the screen space, so the method ismuch simpler than Homogeneous. It can start interpolation from any pointof the screen space, so it does not need a scan line technique to findborder pixel and, above all, it allows more than the rasterizer to workin parallel on the same primitive.

Moreover, the rendering direction is flexible, without adding extracalculations to switch direction. Therefore, according to the change inslope of the edges of a primitive, it is possible to freely changerendering direction.

The various embodiments described above can be combined to providefurther embodiments. All of the U.S. patents, U.S. patent applicationpublications, U.S. patent applications, foreign patents, foreign patentapplications and non-patent publications referred to in thisspecification and/or listed in the Application Data Sheet, areincorporated herein by reference, in their entirety. Aspects of theembodiments can be modified, if necessary to employ concepts of thevarious patents, applications and publications to provide yet furtherembodiments.

These and other changes can be made to the embodiments in light of theabove-detailed description. In general, in the following claims, theterms used should not be construed to limit the claims to the specificembodiments disclosed in the specification and the claims, but should beconstrued to include all possible embodiments along with the full scopeof equivalents to which such claims are entitled. Accordingly, theclaims are not limited by the disclosure.

1. A rasterizing method, comprising: calculating an attribute (C) of apixel having coordinates (X, Y), based on coordinates (X₀, Y₀), (X₁,Y₁), (X₂, Y₂) of vertices of a primitive in a screen space, Zcoordinates Z₀, Z₁ and Z₂ of said vertices in a three-dimensional space,and attributes C₀, C₁, C₂ of said vertices, the calculating including:defining a vertex (X₀, Y₀) as reference, finding H coefficientsH ₀=(ΔX ₂₀ ΔY ₁₀ −ΔY ₂₀ ΔX ₁₀)Z ₁ Z ₂ C ₀H ₁ =−ΔY ₂₀(Z ₀ Z ₂ C ₁ −Z ₁ Z ₂ C ₀)+ΔY ₁₀(Z ₀ Z ₁ C ₂ −Z ₁ Z ₂ C ₀)H ₂ =ΔX ₂₀(Z ₀ Z ₂ C ₁ −Z ₁ Z ₂ C ₀)−ΔX ₁₀(Z ₀ Z ₁ C ₂ −Z ₁ Z ₂ C ₀)H ₃=(ΔX ₂₀ ΔY ₁₀ −ΔY ₂₀ ΔX ₁₀)Z ₁ Z ₂H ₄ =−ΔY ₂₀(Z ₀ Z ₂ −Z ₁ Z ₂)+ΔY ₁₀(Z ₀ Z ₁ −Z ₁ Z ₂)H ₅ =ΔX ₂₀(Z ₀ Z ₂ −Z ₁ Z ₂)−ΔX ₁₀(Z ₀ Z ₁ −Z ₁ Z ₂) whereinΔX_(ij)=X_(i)−X_(j) and ΔY_(ij)=Y_(i)−Y_(i), calculating attribute Cusing the formula:$C = \frac{H_{0} + {H_{1}\Delta \; x} + {H_{2}\Delta \; y}}{H_{3} + {H_{4}\Delta \; x} + {H_{5}\Delta \; y}}$wherein ×x=X−X₀ and Δy=Y−Y₀.
 2. The method according to claim 1, whereinthe attribute C is one of color attributes (R, G, B, A), textureattributes (S, T, Q) and Fog.
 3. The method according to claim 2,further comprising calculating a Z coordinate of pixel (X, Y), using theformula:$Z = {\frac{Z_{0}Z_{1}Z_{2}}{H_{3} + {H_{4}\Delta \; x} + {H_{5}\Delta \; y}}.}$4. The method according to claim 1, comprising a set-up phase in whichthe coefficients H₀-H₅ are calculated only once for all pixelsassociated with a primitive.
 5. The method according to claim 1, furthercomprising, before calculating attribute C of the pixel, testing if thepixel is inside a primitive.
 6. The method according to claim 1,comprising: a set-up phase, in which the coefficients H₀-H₅ arecalculated, a test location phase, in which pixels associated with aprimitive are detected, and an attributes interpolation phase, in whichthe attributes of all the pixels detected are calculated.
 7. The methodaccording to claim 6, in which the test location phase uses a sign of anedge equation of edges of the primitive for detecting if a pixel isinside a primitive.
 8. The method according to claim 6, in which thetest location phase comprises a border pixels detection phase thatdetects pixels crossed by the edges of the primitive.
 9. The methodaccording to claim 8, comprising: calculating the attribute C of borderpixels of the primitive; calculating the attribute C of internal pixelsof the primitive using the following differential formula for anydirection of exploration of the pixels:C _(numi+1) =C _(numi) +H ₁ Δx _(i) +H ₂ Δy _(i)andC _(deni+1) =C _(deni) +H ₄ Δx _(i) +H ₅ Δy _(i), where C_(numi) is thenumerator of the C formula for a pixel with a coordinate and C_(deni) isthe denominator of the C formula for the pixel with coordinate i. 10.The method according to claim 8, comprising: calculating the attribute Cof border pixels of the primitive; calculating the attribute C ofinternal pixels of the primitive using the following differentialformulae by moving in the same row or column by adjacent pixelsC _(numi+1) =C _(numi) +H ₁andC _(deni+1) =C _(deni) +H ₄, for y constant, orC _(numi+1) =C _(numi) +H ₂andC _(deni+1) =C _(deni) +H ₅, for x constant, where C_(numi) is thenumerator of the C formula for a pixel with a coordinate i and C_(deni)is the denominator of the C formula for the pixel with coordinate i. 11.The method according to claim 1, comprising calculating in parallel ofthe attributes C of pixels of different portions of the primitive.
 12. Arasterizer module, comprising: calculating means for calculating anattribute (C) of a pixel having coordinates (X, Y), based on coordinates(X₀, Y₀), (X₁, Y₁), (X₂, Y₂) of vertices of a primitive in a screenspace, Z coordinates Z₀, Z₁ and Z₂ of said vertices intothree-dimensional space, and attributes C₀, C₁, C₂ of said vertices, thecalculating means including: first calculating means for calculating adistance (Δx, Δy) between the coordinates (X, Y) of the pixel andcoordinates of a reference vertex of a primitive; and second calculatingmeans for calculating the attribute (C) with the formula:$C = {\frac{\begin{matrix}{{\left( {{\Delta \; X_{20}\Delta \; Y_{10}} - {\Delta \; Y_{20}\Delta \; X_{10}}} \right)Z_{1}Z_{2}C_{0}} + \left( {{\Delta \; y\; \Delta \; X_{20}} - {\Delta \; x\; \Delta \; Y_{20}}} \right)} \\{\left( {{Z_{0}Z_{2}C_{1}} - {Z_{1}Z_{2}C_{0}}} \right) + {\left( {{\Delta \; x\; \Delta \; Y_{10}} - {\Delta \; y\; \Delta \; X_{10}}} \right)\left( {{Z_{0}Z_{1}C_{2}} - {Z_{1}Z_{2}C_{0}}} \right)}}\end{matrix}}{\begin{matrix}{{\left( {{\Delta \; X_{20}\Delta \; Y_{10}} - {\Delta \; Y_{20}\Delta \; X_{10}}} \right)Z_{1}Z_{2}} + \left( {{\Delta \; y\; \Delta \; X_{20}} - {\Delta \; x\; \Delta \; Y_{20}}} \right)} \\{\left( {{Z_{0}Z_{2}} - {Z_{1}Z_{2}}} \right) + {\left( {{\Delta \; x\; \Delta \; Y_{10}} - {\Delta \; y\; \Delta \; X_{10}}} \right)\left( {{Z_{0}Z_{1}} - {Z_{1}Z_{2}}} \right)}}\end{matrix}}.}$
 13. The rasterizer module according to claim 12,wherein the second calculating means comprises third calculating meansfor finding H coefficients:H ₀=(ΔX ₂₀ ΔY ₁₀ −ΔY ₂₀ ΔX ₁₀)Z ₁ Z ₂ C ₀H ₁ =−ΔY ₂₀(Z ₀ Z ₂ C ₁ −Z ₁ Z ₂ C ₀)+ΔY ₁₀(Z ₀ Z ₁ C ₂ −Z ₁ Z ₂ C ₀)H ₂ =ΔX ₂₀(Z ₀ Z ₂ C ₁ −Z ₁ Z ₂ C ₀)−ΔY ₁₀(Z ₀ Z ₁ C ₂ −Z ₁ Z ₂ C ₀)H ₃=(ΔX ₂₀ ΔY ₁₀ −ΔY ₂₀ ΔX ₁₀)Z ₁ Z ₂H ₄ =−ΔY ₂₀(Z ₀ Z ₂ −Z ₁ Z ₂)+ΔY ₁₀(Z ₀ Z ₁ −Z ₁ Z ₂)H ₅ =ΔX ₂₀(Z ₀ Z ₂ −Z ₁ Z ₂)−ΔX ₁₀(Z ₀ Z ₁ −Z ₁ Z ₂) and fourthcalculating means for calculating attribute (C) as:$C = {\frac{H_{0} + {H_{1}\Delta \; x} + {H_{2}\Delta \; y}}{H_{3} + {H_{4}\Delta \; x} + {H_{5}\Delta \; y}}.}$14. The rasterizer module according to claim 12, further comprisingfifth calculating means for calculating the Z coordinate of the pixel(X, Y) with the formula: $Z = {\frac{Z_{0}Z_{1}Z_{2}}{\begin{matrix}{{\left( {{\Delta \; X_{20}\Delta \; Y_{10}} - {\Delta \; Y_{20}\Delta \; X_{10}}} \right)Z_{1}Z_{2}} + \left( {{\Delta \; y\; \Delta \; X_{20}} - {\Delta \; x\; \Delta \; Y_{20}}} \right)} \\{\left( {{Z_{0}Z_{2}} - {Z_{1}Z_{2}}} \right) + {\left( {{\Delta \; x\; \Delta \; Y_{10}} - {\Delta \; y\; \Delta \; X_{10}}} \right)\left( {{Z_{0}Z_{1}} - {Z_{1}Z_{2}}} \right)}}\end{matrix}}.}$
 15. The rasterizer module according to claim 12,further comprising detecting means for detecting if the pixel is insidethe primitive.
 16. The rasterizer module according to claim 12,comprising: border pixel detecting means for detecting pixels crossed byan edge of the primitive, wherein the second calculating meanscalculates the attribute C of the border pixels of the primitive; andthird calculating means for calculating the attribute C of the internalpixels of the primitive with the formulae:C _(numi+1) =C _(numi) +H ₁ Δx _(i) +H ₂ Δy _(i)andC _(deni+1) =C _(deni) +H ₄ ×x _(i) +H ₅ Δy _(i), where C_(numi) is thenumerator of the C formula for a pixel with a coordinate and C_(deni) isthe denominator of the C formula for the pixel with coordinate i.
 17. Agraphic module, comprising: a geometry stage structured to process aprimitive representing a model of an object to be displayed on a screen;and a rasterizer module arranged downstream of said geometry stage andsuitable for acquiring from the geometry stage primitive coordinates andassociating the primitive coordinates to pixels of the screen, therasterizer module including: calculating means for calculating anattribute (C) of a pixel having coordinates (X, Y), based on coordinates(X₀, Y₀), (X₁, Y₁), (X₂, Y₂) of the vertices of the primitive in ascreen space, Z coordinates Z₀, Z₁ and Z₂ of said vertices into thethree-dimensional space, and attributes C₀, C₁, C₂ of said vertices, thecalculating means including: first calculating means for calculating adistance between the coordinates (X, Y) of the pixel and the coordinatesof a reference vertex of a primitive; second calculating means forcalculating the attribute (C) with the formula:$C = {\frac{\begin{matrix}{{\left( {{\Delta \; X_{20}\Delta \; Y_{10}} - {\Delta \; Y_{20}\Delta \; X_{10}}} \right)Z_{1}Z_{2}C_{0}} + \left( {{\Delta \; y\; \Delta \; X_{20}} - {\Delta \; x\; \Delta \; Y_{20}}} \right)} \\{\left( {{Z_{0}Z_{2}C_{1}} - {Z_{1}Z_{2}C_{0}}} \right) + {\left( {{\Delta \; x\; \Delta \; Y_{10}} - {\Delta \; y\; \Delta \; X_{10}}} \right)\left( {{Z_{0}Z_{1}C_{2}} - {Z_{1}Z_{2}C_{0}}} \right)}}\end{matrix}}{\begin{matrix}{{\left( {{\Delta \; X_{20}\Delta \; Y_{10}} - {\Delta \; Y_{20}\Delta \; X_{10}}} \right)Z_{1}Z_{2}} + \left( {{\Delta \; y\; \Delta \; X_{20}} - {\Delta \; x\; \Delta \; Y_{20}}} \right)} \\{\left( {{Z_{0}Z_{2}} - {Z_{1}Z_{2}}} \right) + {\left( {{\Delta \; x\; \Delta \; Y_{10}} - {\Delta \; y\; \Delta \; X_{10}}} \right)\left( {{Z_{0}Z_{1}} - {Z_{1}Z_{2}}} \right)}}\end{matrix}}.}$
 18. The graphic module according to claim 17, whereinthe second calculating means comprises third calculating means forfinding H coefficients:H ₀=(ΔX ₂₀ ΔY ₁₀ −ΔY ₂₀ ΔX ₁₀)Z ₁ Z ₂ C ₀H ₁ =−ΔY ₂₀(Z ₀ Z ₂ C ₁ −Z ₁ Z ₂ C ₀)+ΔY ₁₀(Z ₀ Z ₁ C ₂ −Z ₁ Z ₂ C ₀)H ₂ =ΔX ₂₀(Z ₀ Z ₂ C ₁ −Z ₁ Z ₂ C ₀)−ΔX ₁₀(Z ₀ Z ₁ C ₂ −Z ₁ Z ₂ C ₀)H ₃=(ΔX ₂₀ ΔY ₁₀ −ΔY ₂₀ ΔX ₁₀)Z ₁ Z ₂H ₄ =−ΔY ₂₀(Z ₀ Z ₂ −Z ₁ Z ₂)+ΔY ₁₀(Z ₀ Z ₁ −Z ₁ Z ₂)H ₅ =ΔX ₂₀(Z ₀ Z ₂ −Z ₁ Z ₂)−ΔX ₁₀(Z ₀ Z ₁ −Z ₁ Z ₂) and fourthcalculating means for calculating attribute (C) as:$C = {\frac{H_{0} + {H_{1}\Delta \; x} + {H_{2}\Delta \; y}}{H_{3} + {H_{4}\Delta \; x} + {H_{5}\Delta \; y}}.}$19. The graphic module according to claim 17, wherein the rasterizermodule includes fifth calculating means for calculating the Z coordinateof the pixel (X, Y) with the formula:$Z = {\frac{Z_{0}Z_{1}Z_{2}}{\begin{matrix}{{\left( {{\Delta \; X_{20}\Delta \; Y_{10}} - {\Delta \; Y_{20}\Delta \; X_{10}}} \right)Z_{1}Z_{2}} + \left( {{\Delta \; y\; \Delta \; X_{20}} - {\Delta \; x\; \Delta \; Y_{20}}} \right)} \\{\left( {{Z_{0}Z_{2}} - {Z_{1}Z_{2}}} \right) + {\left( {{\Delta \; x\; \Delta \; Y_{10}} - {\Delta \; y\; \Delta \; X_{10}}} \right)\left( {{Z_{0}Z_{1}} - {Z_{1}Z_{2}}} \right)}}\end{matrix}}.}$
 20. The graphic module according to claim 17, furthercomprising detecting means for detecting if the pixel is inside theprimitive.
 21. The graphic module according to claim 17, comprising:border pixel detecting means for detecting pixels crossed by an edge ofthe primitive, wherein the second calculating means calculates theattribute C of the border pixels of the primitive; and third calculatingmeans for calculating the attribute C of the internal pixels of theprimitive with the formulae:C _(numi+1) =C _(numi) +H ₁ Δx _(i) +H ₂ Δy _(i)andC _(deni+1) =C _(deni) +H ₄ Δx _(i) +H ₅ Δy _(i), where C_(numi) is thenumerator of the C formula for a pixel with a coordinate i and C_(deni)is the denominator of the C formula for the pixel with coordinate i. 22.A system, comprising: a display screen; and a graphic module thatincludes: a geometry stage structured to process a primitiverepresenting a model of an object to be displayed on the screen; and arasterizer module arranged downstream of said geometry stage andsuitable for acquiring from the geometry stage primitive coordinates andassociating the primitive coordinates to pixels of the screen, therasterizer module including: calculating means for calculating anattribute (C) of a pixel having coordinates (X, Y), based on coordinates(X₀, Y₀), (X₁, Y₁), (X₂, Y₂) of the vertices of a primitive in a screenspace, Z coordinates Z₀, Z₁ and Z₂ of said vertices into thethree-dimensional space, and attributes C₀, C₁, C₂ of said vertices, thecalculating means including: first calculating means for calculating adistance (Δx, Δy) between the coordinates (X, Y) of the pixel and thecoordinates of a reference vertex of a primitive; second calculatingmeans for calculating for calculating the attribute (C) with theformula: $C = {\frac{\begin{matrix}{{\left( {{\Delta \; X_{20}\Delta \; Y_{10}} - {\Delta \; Y_{20}\Delta \; X_{10}}} \right)Z_{1}Z_{2}C_{0}} + \left( {{\Delta \; y\; \Delta \; X_{20}} - {\Delta \; x\; \Delta \; Y_{20}}} \right)} \\{\left( {{Z_{0}Z_{2}C_{1}} - {Z_{1}Z_{2}C_{0}}} \right) + {\left( {{\Delta \; x\; \Delta \; Y_{10}} - {\Delta \; y\; \Delta \; X_{10}}} \right)\left( {{Z_{0}Z_{1}C_{2}} - {Z_{1}Z_{2}C_{0}}} \right)}}\end{matrix}}{\begin{matrix}{{\left( {{\Delta \; X_{20}\Delta \; Y_{10}} - {\Delta \; Y_{20}\Delta \; X_{10}}} \right)Z_{1}Z_{2}} + \left( {{\Delta \; y\; \Delta \; X_{20}} - {\Delta \; x\; \Delta \; Y_{20}}} \right)} \\{\left( {{Z_{0}Z_{2}} - {Z_{1}Z_{2}}} \right) + {\left( {{\Delta \; x\; \Delta \; Y_{10}} - {\Delta \; y\; \Delta \; X_{10}}} \right)\left( {{Z_{0}Z_{1}} - {Z_{1}Z_{2}}} \right)}}\end{matrix}}.}$
 23. The system according to claim 22, wherein thesecond calculating means comprises third calculating means for finding Hcoefficients:H ₀=(ΔX ₂₀ ΔY ₁₀ −ΔY ₂₀ ΔX ₁₀)Z ₁ Z ₂ C ₀H ₁ =−ΔY ₂₀(Z ₀ Z ₂ C ₁ −Z ₁ Z ₂ C ₀)+ΔY ₁₀(Z ₀ Z ₁ C ₂ −Z ₁ Z ₂ C ₀)H ₂ =ΔX ₂₀(Z ₀ Z ₂ C ₁ −Z ₁ Z ₂ C ₀)−ΔX ₁₀(Z ₀ Z ₁ C ₂ −Z ₁ Z ₂ C ₀)H ₃=(ΔX ₂₀ ΔY ₁₀ −ΔY ₂₀ ΔX ₁₀)Z ₁ Z ₂H ₄ =−ΔY ₂₀(Z ₀ Z ₂ −Z ₁ Z ₂)+ΔY ₁₀(Z ₀ Z ₁ −Z ₁ Z ₂)H ₅ =ΔX ₂₀(Z ₀ Z ₂ −Z ₁ Z ₂)−ΔX ₁₀(Z ₀ Z ₁ −Z ₁ Z ₂) and fourthcalculating means for calculating attribute (C) as:$C = {\frac{H_{0} + {H_{1}\Delta \; x} + {H_{2}\Delta \; y}}{H_{3} + {H_{4}\Delta \; x} + {H_{5}\Delta \; y}}.}$24. The system according to claim 22, wherein the rasterizer moduleincludes fifth calculating means for calculating the Z coordinate of thepixel (X, Y) with the formula:$Z = {\frac{Z_{0}Z_{1}Z_{2}}{\begin{matrix}{{\left( {{\Delta \; X_{20}\Delta \; Y_{10}} - {\Delta \; Y_{20}\Delta \; X_{10}}} \right)Z_{1}Z_{2}} + \left( {{\Delta \; y\; \Delta \; X_{20}} - {\Delta \; x\; \Delta \; Y_{20}}} \right)} \\{\left( {{Z_{0}Z_{2}} - {Z_{1}Z_{2}}} \right) + {\left( {{\Delta \; x\; \Delta \; Y_{10}} - {\Delta \; y\; \Delta \; X_{10}}} \right)\left( {{Z_{0}Z_{1}} - {Z_{1}Z_{2}}} \right)}}\end{matrix}}.}$
 25. The system according to claim 22, furthercomprising detecting means for detecting if the pixel is inside theprimitive.
 26. The system according to claim 22, comprising: borderpixel detecting means for detecting pixels crossed by an edge of theprimitive, wherein the second calculating means calculates the attributeC of the border pixels of the primitive; and third calculating means forcalculating the attribute C of the internal pixels of the primitive withthe formulae:C _(numi+1) =C _(numi) +H ₁ Δx _(i) +H ₂ Δy _(i)andC _(deni+1) =C _(deni) +H ₄ Δx _(i) +H ₅ Δy _(i), where C_(numi) is thenumerator of the C formula for a pixel with a coordinate i and C_(deni)is the denominator of the C formula for the pixel with coordinate i.